{% load manager_content_tags %}
{% load utils %}
<div class="ui-table-wrap">
    <table class="ui-table ui-table-border ui-table-hover ui-table-striped ui-mb">
        <thead class="ui-thead-gray">
            <tr>
                <th width="30" height="30"><label class="ui-checkbox tips" data-align="right-top" data-title="全选/取消"><input type="checkbox" class="checkall" value=""><i></i></label></th>
                <th width="80">排序</th>
                <th>标题</th>
                <th width="150">栏目名称</th>
                <th width="50">人气</th>
                <th width="50">缩图</th>
                <th width="50">置顶</th>
                <th width="50">推荐</th>
                <th width="50">状态</th>
                <th width="100">操作</th>
            </tr>
        </thead>
        <tbody>
            {% if not page_obj %}
            <tr>
                <td colspan="8">暂无数据</td>
            </tr>
            {% endif %}
            {% for item in page_obj %}
            <tr>
                <td>
                    <label class="ui-checkbox"><input type="checkbox" name="id" value="{{item.id}}"><i></i></label>
                </td>
                <td><input type="hidden" name="mid[]" value="{{item.id}}"><input type="text" class="ui-form-ip"
                        name="ordnum[]" id="ordnum_{{item.id}}" value="{{item.ordnum}}" data-rule="required;int;">
                </td>
                <td class="ui-text-left">
                    {% if item.isurl == 1 %}<span class="ui-btn ui-btn-yellow ui-btn-lt ui-mr-sm">外链</span>{% endif %}
                    <a href="{{item.link}}" target="_blank" title="查看">{{item.title}}</a> 
                    {% if item.isauto == 1 %}<span class="ui-icon-reloadtime ui-text-yellow" title="定时发布：{date('Y-m-d H:i:s',$rs[createdate])}"></span>{% endif %}
				</td>
                <td><a href="{geturl($rs[classid],0)}">{{ item.catename }}</a></td>
                <td>{{item.hits}}</td>
                <td>{% if item.ispic == 1 %}是{% else %}<em>否</em>{% endif %}</td>
                <td><label class="ui-switch ui-switch-info"><input type="checkbox" {% if item.ontop == 1 %} checked{% endif %} data-url="/manager/content/switchs/?type=1&id={{item.id}}"><span class="ui-switch-checkbox ui-switch-text"></span></label></td>
                <td><label class="ui-switch ui-switch-info"><input type="checkbox" {% if item.isnice == 1 %} checked{% endif %} data-url="/manager/content/switchs/?type=2&id={{item.id}}"><span class="ui-switch-checkbox ui-switch-text"></span></label></td>
                <td>
                    <label class="ui-switch ui-switch-info"><input type="checkbox" {% if item.islock == 1 %} checked{% endif %} data-url="/manager/content/switchs/?type=3&id={{item.id}}"><span class="ui-switch-checkbox ui-switch-text"></span></label>
                </td>
                <td>
                    <a href="javascript:;" class="copy" data-url="/mangaer/content/copy?classid={{item.classid}}&id={{item.id}}" title="复制"><span class="ui-icon-file-copy"></span></a>　
                    <a href="{{ item.classid|get_cate_edit_url:item.id }}" title="编辑"><span class="ui-icon-edit"></span></a>　
                    <a href="javascript:;" class="del" data-url="/manager/content/delete/?id={{item.id}}" title="删除"><span class="ui-icon-delete"></span></a></td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{%if page_obj %}
<div class="ui-page ui-page-right ui-page-info">
    <div class="ui-page-other"><button type="submit" class="ui-btn ui-btn-yellow">保存排序</button></div>
    <div class="ui-page-list">
        <ul>
            {% if page_obj.has_previous %}
                <li><a href="?fid={{ fid }}&page=1">首页</a></li>
                <li><a href="?fid={{ fid }}&page={{ page_obj.previous_page_number }}">上一页</a></li>
            {% endif %}

            <li><a>{{ page_obj.number }}/{{ page_obj.paginator.num_pages }}</a></li>
        {% if page_obj.has_next %}
            <li><a href="?fid={{ fid }}&page={{ page_obj.next_page_number }}">下一页</a></li>
            <li><a href="?fid={{ fid }}&page={{ page_obj.paginator.num_pages }}">末页</a></li>
        {% endif %}
        </ul>
    </div>
</div>
{% endif %}